<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>学生界面</title>
<meta name="description" content="这是学生主页">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="/graduation/img/lysf.ico">
<link rel="stylesheet" href="/graduation/amazeui/css/amazeui.min.css" />
<link rel="stylesheet" href="/graduation/teacher/css/admin.css">
<link rel="stylesheet" href="/graduation/teacher/css/app.css">
</head>

<body style="margin-left: 10px;overflow-x:hidden;" >

	<div id="ref_page" class="am-g">
	
			<div class="tpl-content-page-title" style="margin-bottom: 10px;">审核免答辩申请表</div>

			<ol class="am-breadcrumb">
				<li><a href="/graduation/teacher/tmdbstudentlist.html" class="am-icon-users">申请学生</a></li>
				<li class="am-active">免答辩申请表</li>
			</ol>
			
			<div class="am-panel am-panel-default">
				<div class="am-panel-bd">
					<div class="am-scrollable-horizontal">
							<table class="am-table am-table-bordered  am-table-centered am-text-nowrap">
								<thead>
									<tr>
										<th colspan="9">课程设计题目信息（论文）免答辩申请表</th>
									</tr>
								</thead>
								<tbody>
									<tr id="tr1">
										<td colspan="2">学 号</td>
										<td colspan="2"></td>
										<td>姓 名</td>
										<td colspan="2"></td>
										<td>性 别</td>
										<td></td>
									</tr>
									<tr id="tr2">
										<td colspan="2">专 业</td>
										<td colspan="3"></td>
										<td>年 级</td>
										<td></td>
										<td>班 级</td>
										<td></td>
									</tr>
									<tr id="tr3">
										<td colspan="2">申请人签名</td>
										<td colspan="3"></td>
										<td colspan="2">联系电话</td>
										<td colspan="2"></td>
									</tr>
									<tr id="tr4">
										<td colspan="2">论文题目</td>
										<td colspan="3"></td>
										<td colspan="2">导师姓名</td>
										<td colspan="2"></td>
									</tr>
									<tr style="height: 260px;">
										<td colspan="2" class="am-text-middle">申请理由</td>
										<td colspan="7"><textarea id="column1"
												style="width: 100%; height: 260px;" disabled></textarea></td>
									</tr>
									<tr style="height: 260px;">
										<td colspan="2" class="am-text-middle">指导老师意见</td>
										<td colspan="7"><textarea id="column2"
												style="width: 100%; height: 260px;"></textarea></td>
									</tr>
								</tbody>
							</table>
							<button id="mdb_btn" type="button" class="am-btn am-btn-primary am-radius am-fr"
								data-am-loading="{spinner: 'circle-o-notch', loadingText: '提交中...', resetText: '提交完成'}">
								提交审核意见</button>
					</div>
				</div>
			</div>
			  
	</div>

<script src="/graduation/js/jquery.min.js"></script>
<script src="/graduation/amazeui/js/amazeui.min.js"></script>
<script src="/graduation/teacher/js/app.js"></script>
<script type="text/javascript">
	$(function() {
		
		var studentId=getQueryString("studentId");
		
 		$.get('/graduation/studentController/getStudentAndMdbBySid?studentId='+studentId,function(data){
	 			$('#tr1').find('td').eq(1).text(data.user.userAccount);
				$('#tr1').find('td').eq(3).text(data.user.userName);
				$('#tr1').find('td').eq(5).text(data.user.userGender==1?'男':'女');
				$('#tr2').find('td').eq(1).text(data.classInfo.subject.subjectName);
				$('#tr2').find('td').eq(3).text(data.classInfo.grade.gradeName);
				$('#tr2').find('td').eq(5).text(data.classInfo.className);
				$('#tr3').find('td').eq(3).text(data.user.userTel);
				$('#tr4').find('td').eq(1).text(data.project.projectName);
				$('#tr4').find('td').eq(3).text(data.teacher.user.userName);
				$('#column1').text(data.mdb.column1);
				if(!isNull(data.mdb.column2)){
					$('#column2').attr('disabled','disabled').text(data.mdb.column2);
					$('#mdb_btn').attr('disabled','disabled').text('已提交审核意见');
					return;
				}
				$('#mdb_btn').append($('<input>').attr('type','hidden').val(data.mdb.mdbId));
		}); 
		
		//提交免答辩
		$('#mdb_btn').click(function () {
			  var $btn = $(this);
			  var column2=$('#column2').val();
			  if(isNull(column2)){
				  return;
			  }
			  $.post('/graduation/mdbController/updateColumnById',{
				  '_method':'put',
				  mdbId:$('#mdb_btn').find('input:hidden').val(),
				  column2:column2
			  },function(data){
				  if(data){
					  $btn.button('loading');
					    setTimeout(function(){
					    	disableBtn('mdb_btn','提交完成');
					  }, 3000);
				  }
			  });
			    
		});

	});
</script>
</body>

</html>